package writtenexamination.boss;

import java.util.ArrayList;
import java.util.Collections;

/**
 * @author cyt
 * @create 2020-10-15 下午 7:54
 */
public class Tb {

    public static void main(String[] args) {
        Tb tb = new Tb();
        String[] sensitiveWords = {"hope", "here"};
        tb.filterSensitiveWords("While there is life, there is hope.", sensitiveWords);
    }

    /**
     * "While there is life, there is hope.",["hope", "here"]
     * ["here","here","hope"]
     *
     * @param content        string字符串
     * @param sensitiveWords string字符串一维数组
     * @return string字符串ArrayList
     */
    public ArrayList<String> filterSensitiveWords(String content, String[] sensitiveWords) {
        // write code her
        char[] chars = content.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            StringBuffer stringBuffer = new StringBuffer();
            if (chars[i] != ' ' && chars[i] != ',') {
                stringBuffer.append(chars[i]);
            }
            String string = stringBuffer.toString();
            System.out.println(string);
        }
        return new ArrayList<String>();
    }
}
